package com.atxyj.proxy.statics;

import java.util.Date;

/**
 * @author xieyujiao
 * @description 代理类
 * @date 2021/9/3
 */
public class UserServiceProxy implements UserService {
    //类型定义必须与注入类型对应，否则需要强转
    private  UserServiceImpl target;

    //注入业务层的实现类
    public UserServiceProxy(UserServiceImpl target) {
        this.target = target;
    }

    @Override
    public void getName() {
        System.out.println("==============进入静态代理类===============");
        System.out.println("==============挣到了很多钱===============");
        target.getName();
        System.out.println("准备退出静态代理类，增强业务结束，"+new Date());
    }
}
